<table class="easyui-datagrid" id="potentials_list"
       fit="true" border="false"
       singleSelect="true" fitColumns="true" pagination="true"
       idField="potentials_id" url="y.php?r=potentials/getdata" data-options="onClickRow:window_potentials_click" >
    <thead>
    <tr>
        <th field="potentials_name" width="60">销售机会名称</th>
        <th field="realname" width="60">客户</th>
        <th field="stage" width="80">销售阶段</th>
        <th field="possibility" width="60">成交可能性</th>
        <th field="duedate" width="60">成交日期</th>
        <th field="nextstep" width="60">下一阶段</th>
    </tr>
    </thead>
</table>
<script>
    var form = "<?php echo $form;?>";
    function window_potentials_click(index, row) {
        $("#"+form).find("#<?php echo $form;?>_potentials_name").textbox('setText',row.potentials_name);
        $("#"+form).find("input[name=potentials_id]").val(row.potentials_id);
        $('#win_main_2').window("close");
    }
</script>